{% extends '../admin_nav.html' %}

{% block main %}
<!--用户列表页面-->

<ol class="breadcrumb">
    <li><a href="#">管理首页</a></li>
    <li><span>内容列表</span></li>
</ol>

<h3>内容列表</h3>
<table class="table table-hover table-striped">
    <tr>
        <th>ID</th>
        <th>分类名称</th>
        <th>标题</th>
        <th>作者</th>
        <th>添加时间</th>
        <th>阅读量</th>
        <th>操作</th>

    </tr>
    {% for content in contents %}
    <tr>
        <th>{{content._id.toString()}}</th>
        <!--<th>{{content.category.id.toString()}}</th>-->
        <th>{{content.category.name}}</th>
        <th>{{content.title}}</th>
        <th>{{content.user.username}}</th>
        <th>{{content.addTime | date('Y-m-d H:i:s',-8*60)}}</th>
        <th>{{content.views}}</th>
        <th>
            <a href="/admin/content/edit?id={{content._id.toString()}}">修改</a>
            <a href="/admin/content/delete?id={{content._id.toString()}}">删除</a>
        </th>
    </tr>
    {% endfor %}

</table>

{% include '../user/user_page.html' %}


{% endblock%}
